package com.example.piece.ui.demo.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.example.piece.R
import com.example.piece.databinding.TestItemDeviceBinding
import com.example.piece.BR


/**
 * 设备适配器
 */
class MyDeviceAdapter(data: MutableList<MyDevice>) :
    BaseQuickAdapter<MyDevice, BaseDataBindingHolder<TestItemDeviceBinding>>(R.layout.test_item_device, data) {
    override fun convert(helper: BaseDataBindingHolder<TestItemDeviceBinding>, item: MyDevice) {
        val binding = helper.dataBinding

        val variable = binding?.setVariable(BR.entity, item)
        binding?.setVariable(BR.adapter, this)
        binding?.setVariable(BR.position, helper.layoutPosition)
        binding?.executePendingBindings()
    }



}